package com.scapegoat.pay.web.shop.controller;

import java.io.IOException;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 支付控制类
 *
 * @author walkman
 * @date 2017年10月18日 15:04:23
 */
@Controller
@RequestMapping(value = "/payNotify")
public class PayNotifyController extends BaseController {

    private static final Logger LOG = LoggerFactory.getLogger(PayNotifyController.class);

    @RequestMapping("/notify")
    public String scanPay(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
        Map requestMap = getParamMap_NullStr(httpServletRequest.getParameterMap());
        LOG.info("银行返回结果：{}", requestMap);

        try {
            httpServletResponse.getWriter().print("success");
        } catch (IOException e) {
            LOG.error("回写失败：", e);
        }
        return null;
    }

}
